import React from 'react';
import Header from "./Header";
import Toolbar from "./Toolbar";
import { Badge,Tabs } from 'antd-mobile';
import { connect } from 'react-redux';
import MyList from "./MyList";

const tabs = [
  { title: '科普' },
  { title: <Badge dot>视频</Badge> },
  { title: '推荐' },
];
class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      visible: false,
    }
  }
  componentDidMount() {
  }
  componentWillUnmount = () => {
    this.setState = () => {
      return;
    };
  }
  onSelect = (opt) => {
    this.setState({
      visible: false,
      selected: opt.props.value,
    });
  };
  render() {
    return (
      <div>
        <Header state={this.props} />
        <Tabs tabs={tabs}
          initialPage={0} >
          <div>
            <MyList cType="common" history={this.props.history} />
          </div>
          <div><MyList cType="video" history={this.props.history}  /></div>
          <div><MyList isRec='true' history={this.props.history} /></div>
          <div><MyList history={this.props.history} /></div>
        </Tabs>
        <Toolbar history={this.props.history} selectedTab='Home' />
      </div>
    )
  };
}
export default connect(
  state => ({ currentUser: state.setCurrentUser, currentChild: state.setCurrentChild })
)(App)
